<template>
  <div>
    <div>
      <div class="font15 mt10 pl10">
        <span class="titletext ">{{titledata.title}}</span>
        <div class="graytext  mt10 font13">
          <span>工单编号:</span>
          <span class="titletext">{{titledata.pmInsId}}</span>
        </div>
      </div>
      <!-- 基本信息 -->
      <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
        <div class="blue_item" />
        <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">方案申请</span>
      </div>

      <van-field readonly required name="applyPeople" :value="fromdata.applyPeople" label="申请人:" label-width="4em" />
      <van-field readonly required name="applyPhone" :value="fromdata.applyPhone" label="申请人电话:" label-width="6em" />
      <van-field readonly required name="applyUnit" :value="fromdata.applyUnit" label="地市:" label-width="3em" />
      <van-field readonly required name="applyDepartment" :value="fromdata.applyDepartment" label="县区:"
        label-width="3em" />
      <van-field readonly required name="isSecondPick" :value="fromdata.isSecondPick" label="是否二次甄选:"
        label-width="7em" />
      <van-field readonly required name="pickActivityName" :value="fromdata.pickActivityName" label="甄选活动名称:"
        label-width="7em" />
      <van-field readonly required name="applyCode" :value="fromdata.applyCode" label="甄选活动编码:" label-width="7em" />
      <van-field readonly required name="merchantNumber" :value="fromdata.merchantNumber" label="商机编号:"
        label-width="5em" />
      <van-field readonly required name="pickCategory" :value="fromdata.pickCategory" label="甄选类别:" label-width="5em" />
      <van-field readonly required name="pickBasis" :value="fromdata.pickBasis" label="甄选依据:" label-width="5em" />
      <van-field readonly name="contractType" :value="fromdata.contractType?fromdata.contractType:'无需填写，系统自动带出'"
        label="合同类型:" label-width="5em" />
      <van-field readonly name="contractAmount" :value="fromdata.contractAmount?fromdata.contractAmount:'无需填写，系统自动带出'"
        label="合同金额(元):" label-width="7.5em" />
      <van-field readonly required name="onePickMethod" :value="fromdata.onePickMethod" label="一级甄选方式:"
        label-width="7em" />
      <van-field readonly required name="pickMethod" :value="fromdata.pickMethod" label="二级甄选方式:" label-width="7em" />
      <van-field readonly required name="demandType" :value="fromdata.demandType" label="需求类型:" label-width="5em" />
      <van-field v-if="fromdata.demandType=='政企市场业务需求'" readonly required name="twoDemandType"
        :value="fromdata.twoDemandType" label="二级需求类型:" label-width="7em" />
      <van-field readonly required name="expenditureType" :value="fromdata.expenditureType" label="开支类型:"
        label-width="5em" />
      <van-field readonly required name="materialType" :value="fromdata.materialType" label="物资类型:" label-width="5em" />
      <van-field readonly required name="procurementItemsType" :value="fromdata.procurementItemsType" label="采购项目类型:"
        label-width="7em" />
      <van-field readonly required name="twoProcurementItemsType" :value="fromdata.twoProcurementItemsType"
        label="二级采购项目类型:" label-width="9em" />
      <van-field readonly required name="proposedContractType" :value="fromdata.proposedContractType" label="拟签署合同类型:"
        label-width="8em" />
      <van-field readonly required name="draft" :value="fromdata.draft" label="拟合作供应商数量:" label-width="9em" />
      <van-field readonly required name="noticeType" :value="fromdata.noticeType" label="公告类型:" label-width="5em" />
      <div v-if="showFAView">
        <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
          <div class="blue_item" />
          <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">方案创建</span>
        </div>
        <van-field readonly required name="undertakeName" :value="fromdata.undertakeName" label="承办人姓名:"
          label-width="6em" />
        <van-field readonly required name="undertakeDepartment" :value="fromdata.undertakeDepartment" label="承办人部门:"
          label-width="6em" />
        <van-field readonly required name="programmeDecisionDate" :value="fromdata.programmeDecisionDate"
          label="方案决策时间:" label-width="7em" />
        <van-field readonly required name="programmeHierarchy" :value="fromdata.programmeHierarchy" label="方案决策层级:"
          label-width="7em" />
        <van-field readonly required name="isAnnouncement" :value="fromdata.isAnnouncement" label="是否ES公告:"
          label-width="6.5em" />
        <div v-if="fromdata.isAnnouncement=='是'">
          <van-field readonly required name="announcementSpreadTime" :value="fromdata.announcementSpreadTime"
            label="公告挂网时间:" label-width="7em" />
          <van-field readonly required name="announcementCode" :value="fromdata.announcementCode" label="公告编码:"
            label-width="5em" />
          <van-field readonly required name="announcementName" :value="fromdata.announcementName" label="公告名称:"
            label-width="5em" />
          <van-field readonly required autosize type="textarea" rows="1" name="pickText" :value="fromdata.pickText"
            label="甄选公告正文:" label-width="7em" />
        </div>
        <van-field readonly required name="pickPlanFileList" label="甄选方案:" label-width="5em" />
        <div v-for="(fileitem) in fromdata.pickPlanFileList" :key="fileitem.id" style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
        <van-field readonly required name="pickFileList" label="甄选文件:" label-width="5em" />
        <div v-for="(fileitem) in fromdata.pickFileList" :key="fileitem.id" style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
        <van-field v-if="fromdata.onePickMethod=='标前甄选'&&fromdata.isAnnouncement=='是'" readonly required
          name="meetingMinutesFileList" label="会议纪要:" label-width="5em" />
        <div v-for="(fileitem) in fromdata.meetingMinutesFileList" :key="fileitem.id" style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
      </div>
      <div v-if="showFAView&&(fromdata.pickMethod=='邀请甄选'||fromdata.pickMethod=='定向邀约')">
        <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
          <div class="blue_item" />
          <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">甄选伙伴编码列表新增</span>
        </div>
        <el-table :data="fromdata.pickRelationPartnerList" border style="width: 100%">
          <el-table-column prop="pickScene" label="甄选场景" />
          <el-table-column prop="partnerName" label="合作伙伴名称" />
          <el-table-column prop="contact" label="联系人" />
          <el-table-column prop="applyPhone" label="联系人手机号" />
          <el-table-column prop="city" label="地市" />
        </el-table>
      </div>
      <!-- <van-field readonly required label-width="12em" label="前向合同签约扫描件文件:" />
    <div v-for="(fileitem) in fromdata.oldContractDocument" :key="fileitem.id" style="margin-left:20px">
      <div readonly class="font14 fileLink" style="color:#0F85CF">
        <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
      </div>
    </div> -->
      <historyAndSuggs id='target' :showHistory='showHistory' :historydata='historydata' :approveList='approveList' />
    </div>
  </div>
</template>
 
<script>
import { openFileUrl } from '@/store/openFile'
import historyAndSuggs from "@/views/srqr/historyAndSuggs.vue"
export default {
  data() {
    return {
    }
  },
  props: ['titledata','businessdata','fromdata','showHistory','historydata','approveList','showFAView'],
  methods: {
     tomsg () {
      document.getElementById('target').scrollIntoView({ behavior: 'smooth' })
    },
    openFileUrlfun(value) {
      this.$router.push(
        {
          name: 'fileview',
          query: {
            openFileUrl: openFileUrl(value)
          }
        }
      );
    },
  },
  components: {
    historyAndSuggs
  },
}
</script>
 
<style>
.tables.el-table .cell {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
    line-height: 15px;
    padding-left: 5px;
    padding-right: 5px;
}
</style>